package com.heimao.dao.userMapper;


import com.heimao.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserAnnotateMapper {

     @Select("select * from sys_user")
     List<User> getUserList();

     @Select("select * from sys_user where account like \"%\"#{name}\"%\"")
     List<User> getUserByParam(Map<String,Object> map);

     @Select("select * from sys_user where id = #{id}")
     User getUser(@Param("id") int id);

     @Insert("insert into activity.sys_user (account,phone,nickname,create_time,update_time,password,status) values(#{account},#{phone},#{nickname},#{createTime},#{updateTime},#{password},#{status})")
     int addUser(User user);

     @Insert("insert into activity.sys_user (account,password) values(#{userName},#{password})")
     int addUsers(Map<String,Object> map);

     @Update("update activity.sys_user set account=#{account},phone=#{phone},nickname=#{nickname},create_time=#{createTime},update_time=#{updateTime},password=#{password},status=#{status} where id = #{id}")
     int updateUser(User user);

     @Delete("delete from activity.sys_user where id = #{id}")
     int deleteUser(int id);


}
